<%@page import="org.firestorm.traficforecast.utils.Constant"%>
<%@page import="org.firestorm.traficforecast.database.UserDAO"%>
<%
String context = request.getContextPath();

String userName = request.getParameter("login");
String password = request.getParameter("password");
int result = UserDAO.checkLogin(userName, password);
if (result == Constant.LOGIN_SUCCESS) {
	
	session.setAttribute("user", UserDAO.getUser(userName, password));
	response.sendRedirect(context + "/login.jsp?error=" + result);
} else {
	response.sendRedirect(context + "/login.jsp?error=" + result);
}
%>